<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px"><head>
    <title><!--不正常航班--></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/project/ui-input-v3.css">
    <link rel="stylesheet" href="css/project/ui-res-v3.css">
    <link rel="stylesheet" href="css/project/ui-color-v3.css">
    <link rel="stylesheet" href="css/project/ui-btn-v3.css">
	 <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
	<link rel="stylesheet" href="css/project/style.css">
	<link rel="stylesheet" href="css/zv_common.css">
    <script src="js/zy_control.js"></script>
	<script src="js/zy_click.js"></script>
	<script src="js/zy_json.js"></script>
	 <script src="js/zy_click.js"></script>
    <script src="js/main.js"></script>
	<script src="js/init.js"></script>
	<script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
	<script src="js/talkingdata.js"></script>
	<style>
	.unnotime{ background:#b6c4d8;}
	.unnotli{ text-align:center; border-bottom:1px solid #999; border-right:1px solid #999}
	.unnotlib{ background:#e9eff8; }
	.left_x{border-left:1px solid #999}
	.left_x_top{ border-top:1px solid #999; }
	</style>
</head>
<body class="um-vp" ontouchstart >
<div class="up ub ub-ver">
	<div class='ub umh3 ulev0 unnotime uinn ub-ac'>
    	<div class="ub-f1 umh3"><span id="flightBeginDate">&nbsp;</span><span id="cross">　至　</span><span id="flightEndDate">&nbsp;</span></div>
        <div onclick="LoadDataS()"><img src="images/note.png" width="80%"></div>
    </div>
    <div class="ub uinn">
    	<div class="ub umw4 ub-ver">
        	<div class="ub umh2" style="height:2em; line-height:2em;" ></div>
        	<div class="zv_hh unnotli unnotlib left_x left_x_top">取消</div>
            <div class="zv_hh unnotli unnotlib left_x">延误</div>
            <div class="zv_hh unnotli unnotlib left_x" style=" padding:0 0.2em;">始发站机场变更</div>
            <div class="zv_hh unnotli unnotlib left_x">返航</div>
            <div class="zv_hh unnotli unnotlib left_x">备降</div>
            <div class="zv_hh unnotli unnotlib left_x">取消和延误</div>
            <div class="zv_hh unnotli unnotlib left_x">全部</div>
        </div>
        <div class="ub ub-f1 ub-ver ub b-bla">
        	<div class=" uc-t tx-c" style="height:2em;line-height:2em; background:#b6c4d8;color:#FFF;">MU</div>
        	<div class="zv_hh unnotli left_x_top" id="CNLMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLMU')" >&nbsp;</div>
            <div class="zv_hh unnotli" id="OPMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('OPMU')">&nbsp;</div>
            <div class="zv_hh unnotli" id="SHAMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('SHAMU')">&nbsp;</div>
            <div class="zv_hh unnotli" id="RTBMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('RTBMU')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALTMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALTMU')">&nbsp;</div>
            <div class="zv_hh unnotli" id="CNLOPMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLOPMU')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALLMU" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALLMU')">&nbsp;</div>
        </div>
        <div class="ub ub-f1  ub-ver">
        	<div class=" uc-t tx-c" style="height:2em; line-height:2em; background:#b6c4d8;color:#FFF;  ">FM</div>
           	<div class="zv_hh unnotli left_x_top" id="CNLFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="OPFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('OPFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="SHAFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('SHAFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="RTBFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('RTBFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALTFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALTFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="CNLOPFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLOPFM')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALLFM" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALLFM')">&nbsp;</div>
        </div>
        <div class="ub ub-f1 ub-ver">
        	<div class="uc-t tx-c" style="height:2em;  line-height:2em; background:#b6c4d8;color:#FFF; ">KN</div>		
            <div class="zv_hh unnotli left_x_top" id="CNLKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="OPKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('OPKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="SHAKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('SHAKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="RTBKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('RTBKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALTKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALTKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="CNLOPKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('CNLOPKN')">&nbsp;</div>
            <div class="zv_hh unnotli" id="ALLKN" ontouchstart="zy_touch('zv-btn-act')"   onclick="LoadDataS('ALLKN')">&nbsp;</div>
        </div>
    </div>
	<div ontouchstart="zy_touch('zv-btn-act')" class="zvbtn  c-blu1  t-wh tx-c uc-a1 zvbtnpadding"   onclick="LoadDataS()">查看详情</div>	
</div>
</body><script>
zy_init();
window.uexOnload=function(type){
	if(!type){
		uexWindow.setBounce("0");
		IC.talkingDataCount("不正常航班","0013");
	}
	//Loading(0);	
	var flightBeginDate= localStorage.getItem("flightBeginDate"); 
	document.getElementById("flightBeginDate").innerHTML=flightBeginDate;//开始时间
	var flightEndDate= localStorage.getItem("flightEndDate"); 
	document.getElementById("flightEndDate").innerHTML=flightEndDate;//结束时间
	
	
	var json= localStorage.getItem("zvData"); 
	json=json.replace('"iRRFlightList":{"','"iRRFlightList":[{"'); //字符替换 
	json=json.replace('}}}','}]}}'); //字符替换 
	var nojson = JSON.parse(json);
	var CNLMU = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='CNL' && flightCarrier=='MU' )", nojson);//取消MU
	
	document.getElementById("CNLMU").innerHTML=CNLMU.length;
	
	
	var OPMU = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='OP' && flightCarrier=='MU' )", nojson);//延误MU
	document.getElementById("OPMU").innerHTML=OPMU.length;
	var SHAMU = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='SHA' && flightCarrier=='MU' )", nojson);//始发站机场变更MU
	document.getElementById("SHAMU").innerHTML=SHAMU.length;
	var RTBMU = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='RTB' && flightCarrier=='MU' )", nojson);//返航MU
	document.getElementById("RTBMU").innerHTML=RTBMU.length;
	var ALTMU = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='ALT' && flightCarrier=='MU' )", nojson);//备降MU
	document.getElementById("ALTMU").innerHTML=ALTMU.length;
	var CNLOPMU = jsonsql.query("select * from json.return.iRRFlightList where ((deleteFlag=='CNL'  || deleteFlag=='OP' )  && flightCarrier=='MU') ", nojson);//取消和延误MU
	document.getElementById("CNLOPMU").innerHTML=CNLOPMU.length;
	var ALLMU = jsonsql.query("select * from json.return.iRRFlightList where (flightCarrier=='MU' )", nojson);//以上全部类型MU
	document.getElementById("ALLMU").innerHTML=ALLMU.length;
	
	
	var CNLFM  = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='CNL' && flightCarrier=='FM' )", nojson);//取消FM
	document.getElementById("CNLFM").innerHTML=CNLFM.length;	
	var OPFM = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='OP' && flightCarrier=='FM' )", nojson);//延误FM
	document.getElementById("OPFM").innerHTML=OPFM.length;	
	var SHAFM = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='SHA' && flightCarrier=='FM' )", nojson);//始发站机场变更FM
	document.getElementById("SHAFM").innerHTML=SHAFM.length;	
	var RTBFM = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='RTB' && flightCarrier=='FM' )", nojson);//返航FM
	document.getElementById("RTBFM").innerHTML=RTBFM.length;	
	var ALTFM = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='ALT' && flightCarrier=='FM' )", nojson);//备降FM
	document.getElementById("ALTFM").innerHTML=ALTFM.length;	
	var CNLOPFM = jsonsql.query("select * from json.return.iRRFlightList where ((deleteFlag=='CNL'  || deleteFlag=='OP')   && flightCarrier=='FM' )", nojson);//取消和延误FM
	document.getElementById("CNLOPFM").innerHTML=CNLOPFM.length;	
	var ALLFM = jsonsql.query("select * from json.return.iRRFlightList where (flightCarrier=='FM' )", nojson);//以上全部类型FM
	document.getElementById("ALLFM").innerHTML=ALLFM.length;	
	
	var CNLKN  = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='CNL' && flightCarrier=='KN' )", nojson);//取消KN	
	document.getElementById("CNLKN").innerHTML=CNLKN.length;	
	var OPKN = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='OP' && flightCarrier=='KN' )", nojson);//延误KN
	document.getElementById("OPKN").innerHTML=OPKN.length;	
	var SHAKN = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='SHA' && flightCarrier=='KN' )", nojson);//始发站机场变更KN
	document.getElementById("SHAKN").innerHTML=SHAKN.length;	
	var RTBKN = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='RTB' && flightCarrier=='KN' )", nojson);//返航KN
	document.getElementById("RTBKN").innerHTML=RTBKN.length;	
	var ALTKN = jsonsql.query("select * from json.return.iRRFlightList where (deleteFlag=='ALT' && flightCarrier=='KN' )", nojson);//备降KN
	document.getElementById("ALTKN").innerHTML=ALTKN.length;	
	var CNLOPKN = jsonsql.query("select * from json.return.iRRFlightList where  ((deleteFlag=='CNL'  || deleteFlag=='OP')   && flightCarrier=='KN')", nojson);//取消和延误KN
	document.getElementById("CNLOPKN").innerHTML=CNLOPKN.length;	
	var ALLKN = jsonsql.query("select * from json.return.iRRFlightList where (flightCarrier=='KN' )", nojson);//以上全部类型KN
	document.getElementById("ALLKN").innerHTML=ALLKN.length;	

	/**$.getJSON("data/airport.json", function(jjson){
		var jjson=JSON.stringify(jjson)
		alert(jjson)
		var asss = JSON.parse(jjson);
		alert(asss)
		var res = jsonsql.query("select * from json.data.items where (FirstLetter=='F')", asss);

		for(var c=0;c<res.length;c++)
		{
			alert(res[c].FullName)
		}
	});*/

}
function LoadDataS(where)
{
	IC.talkingDataCount("不正常航班","0013");
	checkUserRole(ZV_EMPLOYEE_NUMBER,'BTN_8_27',function(){LoadDataS2(where);});
	//LoadDataS2(where)
}
	function LoadDataS2(where){
		Loading(0);
		    var json= localStorage.getItem("zvData"); 
			var where= where; 
			var sqlwhere=''
			if(where=='CNLMU')//取消MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消MU'}");
				sqlwhere="where (deleteFlag=='CNL' && flightCarrier=='MU' )"
			}
			else if(where=='OPMU')//延误MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班延误MU'}");
				sqlwhere="where (deleteFlag=='OP' && flightCarrier=='MU' )"
			}
			else if(where=='SHAMU')//始发站机场变更MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班始发站机场变更MU'}");
				sqlwhere="where (deleteFlag=='SHA' && flightCarrier=='MU' )"
			}
			else if(where=='RTBMU')//返航MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班返航MU'}");
				sqlwhere="where (deleteFlag=='RTB' && flightCarrier=='MU' )"
			}
			else if(where=='ALTMU')//备降MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班备降MU'}");
				sqlwhere="where (deleteFlag=='ALT' && flightCarrier=='MU' )"
			}
			else if(where=='CNLOPMU')//取消和延误MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消和延误MU'}");
				sqlwhere="where ((deleteFlag=='CNL' || deleteFlag=='OP') && flightCarrier=='MU' )"
			}
			else if(where=='ALLMU')//以上全部类型MU
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班以上全部类型MU'}");
				sqlwhere="where (flightCarrier=='MU' )"
			}
			else if(where=='CNLFM')//取消FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消FM'}");
				sqlwhere="where (deleteFlag=='CNL' && flightCarrier=='FM' )"
			}
			else if(where=='OPFM')//延误FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班延误FM'}");
				sqlwhere="where (deleteFlag=='OP' && flightCarrier=='FM' )"
			}
			else if(where=='SHAFM')//始发站机场变更FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班始发站机场变更FM'}");
				sqlwhere="where (deleteFlag=='SHA' && flightCarrier=='FM' )"
			}
			else if(where=='RTBFM')//返航FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班返航FM'}");
				sqlwhere="where (deleteFlag=='RTB' && flightCarrier=='FM' )"
			}
			else if(where=='ALTFM')//备降FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班备降FM'}");
				sqlwhere="where (deleteFlag=='ALT' && flightCarrier=='FM' )"
			}
			else if(where=='CNLOPFM')//取消和延误FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消和延误FM'}");
				sqlwhere="where ((deleteFlag=='CNL' || deleteFlag=='OP')&& flightCarrier=='FM' )"
			}
			else if(where=='ALLFM')//以上全部类型FM
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班以上全部类型FM'}");
				sqlwhere="where (flightCarrier=='FM' )"
			}
			else if(where=='CNLKN')//取消KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消KN'}");
				sqlwhere="where (deleteFlag=='CNL' && flightCarrier=='KN' )"
			}
			else if(where=='OPKN')//延误KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班延误KN'}");
				sqlwhere="where (deleteFlag=='OP' && flightCarrier=='KN' )"
			}
			else if(where=='SHAKN')//始发站机场变更KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班始发站机场变更KN'}");
				sqlwhere="where (deleteFlag=='SHA' && flightCarrier=='KN' )"
			}
			else if(where=='RTBKN')//返航KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班返航KN'}");
				sqlwhere="where (deleteFlag=='RTB' && flightCarrier=='KN' )"
			}
			else if(where=='ALTKN')//备降KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班备降KN'}");
				sqlwhere="where (deleteFlag=='ALT' && flightCarrier=='KN' )"
			}
			else if(where=='CNLOPKN')//取消和延误KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班取消和延误KN'}");
				sqlwhere="where ((deleteFlag=='CNL' || deleteFlag=='OP') && flightCarrier=='KN' )"
			}
			else if(where=='ALLKN')//以上全部类型KN
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班以上全部类型KN'}");
				sqlwhere="where (flightCarrier=='KN' )"
			}
			else
			{
				uexEMM.setEvent("1","{'不正常航班':'不正常航班详情'}");
				sqlwhere=''
			}
			
			var json= localStorage.getItem("zvData"); 
			json=json.replace('"iRRFlightList":{"','"iRRFlightList":[{"'); //字符替换 
			json=json.replace('}}}','}]}}'); //字符替换 
			var nojson = JSON.parse(json);
			var objdata = jsonsql.query("select * from json.return.iRRFlightList "+sqlwhere, nojson);
			Loading(-1);
			if(objdata!='')
			{
				var aToStr=JSON.stringify(objdata); 	
				localStorage.setItem("json",aToStr); 
				openNewWin('unnormal_flightresult_detail','unnormal_flightresult_detail.html');
			}
			
		
	}
   
</script>
</html>
